package com.code2roc.fastface.db;

import java.util.HashMap;
import java.util.List;

public interface BaseService<T extends BaseModel> {
    void insert(T entity);

    void delete(String unitguid);

    void update(T entity);

    void save(T entity);

    T selectOne(String unitguid);

    Page selectPage(String columns, String where, String orderBy, HashMap<String, Object> paramMap);

    List<T> selectPageList(String columns, String where, String orderBy, HashMap<String, Object> paramMap);

    List<T> selectList(String columns, String where, String orderBy, HashMap<String, Object> paramMap);

    int selectCount(String where, HashMap<String, Object> paramMap);

    T selectOneByField(String fieldName, Object filedValue);

    void deleteByField(String fieldName, Object filedValue);

    void deleteAll();

    List<T> selectAllList();

    List<T> selectListByField(String filedName, Object filedValue);

    List<T> selectRangeList(List<String> rowIDList);

    List<T> selectRangeListByField(String filedName, List<String> rowIDList);

    boolean checkExist(String fieldName, Object fieldValue);

    boolean checkExist(String fieldName, Object fieldValue, String rowID);
}
